home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / c_edit.arc / ED7.C < prev    next >
C/C++ Source or Header  |  1991-09-08  |  3KB  |  167 lines

  1. /* ED7.C */
  2.  
  3. #include "ed0.c"
  4. #include "ed1.ccc"
  5. char pmtln[MAXLEN];
  6. char pmtrfn[SYSFNMAX];        /* now both read and write filenames */
  7. char pmtwfn[SYSFNMAX];
  8. pmtmess(s1,s2) char *s1, *s2;
  9. {
  10. int x,y;
  11.     x=outxget();
  12.     y=outyget();
  13.     outxy(0,0);
  14.     outdelln();
  15.     pmt1line();
  16.     pmt1col(x);
  17.     scr_chr_attr(SETINTENSE);
  18.     fmtsout(s1,outxget());
  19.     fmtsout(s2,outxget());
  20.     scr_chr_attr(SETFAINT);
  21.     syscin();
  22.     pmt1line();
  23.     pmt1col(x);
  24.     pmt1file(pmtrfn);
  25.     pmt2file(pmtwfn);
  26.     pmt1mode(pmtln);
  27.     outxy(x,y);
  28. }
  29. pmtmode(s) char *s;
  30. {
  31. int x,y;
  32.     x=outxget();
  33.     y=outyget();
  34.     outxy(0,0);
  35.     outdelln();
  36.     pmt1line();
  37.     pmt1col(x);
  38.     pmt1file(pmtrfn);
  39.     pmt2file(pmtwfn);
  40.     pmt1mode(s);
  41.     outxy(x,y);
  42. }
  43. pmtrfile(s) char *s;    /*changed: readfile */
  44. {
  45. int x,y;
  46.     x=outxget();
  47.     y=outyget();
  48.     outxy(0,0);
  49.     outdelln();
  50.     pmt1line();
  51.     pmt1col(x);
  52.     pmt1file(s);
  53.     pmt2file(pmtwfn);  /* add writefile */
  54.     pmt1mode(pmtln);
  55.     outxy(x,y);
  56. }
  57. pmtwfile(s) char *s;    /* new: writefile */
  58. {
  59. int x,y;
  60.     x=outxget();
  61.     y=outyget();
  62.     outxy(0,0);
  63.     outdelln();
  64.     pmt1line();
  65.     pmt1col(x);
  66.     pmt1file(pmtrfn);
  67.     pmt2file(s);
  68.     pmt1mode(pmtln);
  69.     outxy(x,y);
  70. }
  71. pmtedit()
  72. {
  73.     pmtmode("edit:     ");    /* add blanks to assure erasing "command" */
  74. }
  75. pmtline()
  76. {
  77. int x,y;
  78.     x=outxget();
  79.     y=outyget();
  80.     outxy(0,0);
  81.     outdelln();
  82.     pmt1line();
  83.     pmt1col(x);
  84.     pmt1file(pmtrfn);    /* change: separate read and write files */
  85.     pmt2file(pmtwfn);
  86.     pmt1mode(pmtln);
  87.     outxy(x,y);
  88. }
  89. pmtcol()
  90. {
  91. int x,y;
  92.     x=outxget();
  93.     y=outyget();
  94.     pmt1col(x);
  95.     outxy(x,y);
  96. }
  97. pmtcmnd(mode,buffer) char *mode, *buffer;
  98. {
  99. int x,y;
  100.     x=outxget();
  101.     y=outyget();
  102.     pmt1mode(mode);
  103.     getcmnd(buffer,outxget());
  104. }
  105. pmt1mode(s) char *s;
  106. {
  107. int i;
  108.     outxy(60,0);        /* change of column location */
  109.     scr_chr_attr(SETINTENSE);
  110.     fmtsout(s,60);
  111.     scr_chr_attr(SETFAINT);
  112.     i=0;
  113.     while (pmtln[i++]= *s++) {
  114.         ;
  115.     }
  116. }
  117. pmt1file(s) char *s;
  118. {
  119. int i;
  120.     outxy(25,0);
  121.     scr_chr_attr(SETINTENSE);
  122.     if (*s==EOS) {
  123.         fmtsout("no rdfile",25);    /* change of message */
  124.     }
  125.     else {
  126.         fmtsout(s,25);
  127.     }
  128.     scr_chr_attr(SETFAINT);
  129.     i=0;
  130.     while (pmtrfn[i++]= *s++) {
  131.         ;
  132.     }
  133. }
  134. pmt2file(s) char *s;    /* new: write out writefile name or "no wrtfile" */
  135. {
  136. int i;
  137.     outxy(40,0);
  138.     scr_chr_attr(SETINTENSE);
  139.     if (*s==EOS) {
  140.         fmtsout("no wrtfile",40);
  141.     }
  142.     else {
  143.         fmtsout(s,40);
  144.     }
  145.     scr_chr_attr(SETFAINT);
  146.     i=0;
  147.     while (pmtwfn[i++]= *s++) {
  148.         ;
  149.     }
  150. }
  151. pmt1line()
  152. {
  153.     outxy(0,0);
  154.     scr_chr_attr(SETINTENSE);
  155.     fmtsout("line: ",0);
  156.     putdec(bufln(),5);
  157.     scr_chr_attr(SETFAINT);
  158. }
  159. pmt1col(x) int x;
  160. {
  161.     outxy(12,0);
  162.     scr_chr_attr(SETINTENSE);
  163.     fmtsout("column: ",12);
  164.     putdec(x,3);
  165.     scr_chr_attr(SETFAINT);
  166. }
  167.